#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : embedding_server.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/10 14:13
from fastapi import Security

from apps import logic
from apps.api.v1.embedding_server_api import embedding_server_router
from apps.api.v1.embedding_server_api.schema import EmbeddingServerListRequests, EmbeddingServerListResponse
from apps.models import User
from apps.utils import get_current_user


@embedding_server_router.post('/list', name='分页获取向量抽取服务', response_model=EmbeddingServerListResponse)
async def embedding_server_router(
        *,
        user: User = Security(get_current_user),
        query: EmbeddingServerListRequests
):
    count, data = await logic.embedding_server_logic.embedding_server_list(query=query)
    return {
        'code': 0,
        "message": "成功",
        "count": count,
        "data": data
    }
    pass
